I have come across the following analogous facts both in the differential and in the algebraic setting:
Algebraic setting: The Zariski (or abstract) tangent space to a quasiprojective variety $M$ at a point $p$ is defined to be $\left(\frac{\mathfrak{m}_p}{\mathfrak{m}_p^2}\right)^*$ where $(\mathcal{O}_{M,p},\mathfrak{m}_p)$ is the local ring of germs of regular functions at $p$ (and $\mathfrak{m}_p$ is of course the maximal ideal of germs vanishing at $p$).
As far as I have understood, this is justified by the fact that in the affine case we can define a very concrete, immersed tangent space as the collections of all tangent lines at a point and indeed it is isomorphic to the aboveDifferential setting: Given the local ring of germs of differentiable functions on a manifold $M$ at a point $p\in M$, $(\mathcal{C}^\infty_p,\mathfrak{m}_p)$, there is an isomoprhism between the tangent space, i.e. the space of tangent vectors, and $\left(\frac{\mathfrak{m}_p}{\mathfrak{m}_p^2}\right)^*$
Given that the two settings ar so different, in particular with respect to the notion of Zariski vs Euclidean locality, I am quite stunned by this commonality and wonder if there is a deeper meaning I am missing.
In particular which is the meaning of $\mathfrak{m}_p^2$ in both contexts? Does it express somehow the notion of germs vanishing at the second order? Then what is the meaning of $\left(\frac{\mathfrak{m}_p}{\mathfrak{m}_p^2}\right)^*$ and why does it express somehow canonically the notion of tangent space? Is there a context where both the algebraic and differential setting can be compared?
Thanks in advance