In my lectures about manifolds, I learned about the statement $ \partial \partial M = \varnothing $ where $M$ notates a manifold and $\partial M$ its boundary.
My professor said, it is similar to the statement in differential geometry, that $ d^2 = 0 $ where $d$ is the exterior derivative.
What is the underlying cause for $ \partial \partial M $ being always empty? What theory connects the statements $d^2 = 0$ and $\partial\partial M = \varnothing$? Are there similar statements like the two given?
Please note, that I am not looking for a proof or explanation of why $\partial \partial M = \varnothing$ is true. I am asking about a theory explaining the underlying structure of the given statements.
I believe it could be something about comology theory but please enlighten me.
Edit:
The comment from @Aurelio is a very good reformulation of my questions:
My understanding is that OP wants to know the general framework in which to say that $\partial^2=0$ is the same phenomenon as $d^2=0$.
The relation between $\partial$ and $d$ can be described as a duality of chain complexes. Here's a very rough outline of what I mean by that.
One basic object in homology theory is the chain complex, which is a sequence of spaces and maps between them. Throughout I'll use real vector spaces and linear maps, and use $0$ to denote the trivial vector space and the zero map. (Elsewhere, other categories are frequently used.) $$ V_0\xrightarrow{\delta_1}V_1\xrightarrow{\delta_2}\dots\xrightarrow{\delta_N}V_N $$ Such a sequence is a chain complex if the composition of any two maps is the zero map, i.e. $\delta_{i+1}\circ\delta_i=0$. We can take duals and adjoints and obtain a dual sequence. $$ V_0^*\xleftarrow{\delta_1^*}V_1^*\xleftarrow{\delta_2^*}\dots\xleftarrow{\delta_N^*}V_N^* $$ It's not difficult to show that if a sequence is a chain complex, then so is its dual.
On a compact $n$-manifold $M$, differential forms form a complex known as the De Rham complex. $$ 0\xrightarrow{d}\Omega^1M\xrightarrow{d}\Omega^2M\xrightarrow{d}\dots\xrightarrow{d}\Omega^nM\xrightarrow{d}0 $$ Here $\Omega^kM$ denotes the space of $k$-forms.
We can similarly construct an complex of submanifolds of $M$ using the boundary operator $\partial$, but making it into a sequence of vector spaces is not so trivial. One standard way is via (smooth) singular simplicial chains, but there are many others. In such a construction, we obtain vector spaces $C_k$ consisting of $k$-dimensional submanifolds (or some suitable generalization thereof), and formal linear combinations of these submanifolds. The boundary operator $\partial$ can be extended linearly to a map $C_{k+1}\to C_k$, giving rise to an chain complex, which I'll call the singular chain complex. $$ 0\xleftarrow{\partial}C_1M\xleftarrow{\partial}C_2M\xleftarrow{\partial}\dots\xleftarrow{\partial}C_nM\xleftarrow{\partial}0 $$ The key point is that the De Rham complex and the singular chain complex are dual to each other. The pairing is given by integration: If $S\in C_kM$ is a submanifold, and $\omega\in\Omega^kM$, we can define $$ \langle\omega,S\rangle:=\int_S\omega|_{S} $$ and extend this pairing linearly to all of $\Omega^kM\times C_kM$. Using Stokes' theorem $$ \int_{S}d\omega|_{S}=\int_{\partial S}\omega|_{\partial S} $$ we see that $d$ is the adjoint of $\partial$ with respect to this pairing. While this is not an isomorphism ($\Omega^kM$ is only a subset of $(C_kM)^*$) the two complexes are "essentially the same" (in a sense made precise by the De Rahm theorem).