How did people figure out that parabolas, hyperbolas, circles, and ellipses were conic sections? Maybe it is not surprising if one thinks that parabolas, hyperbolas, circles, and ellipses are relatives because they all have kind of the same form of equations, i.e.,
$$
Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0,
$$
where different values of $A, B, C, D, E,$ and $F$, as well as their relations, give different kinds of curves.
But how did people figure out they were all conic sections (how could one see a cone from that second-order equation)?
Or was it the case that someone were playing with cones and somehow wondered how a cone could be cut in different ways and figured out that the edges from those cuts were all related through the above equation?

It's the other way around: in ancient Greece parabolas, hyperbolas and ellipses were defined as sections of a cone. From that definition, one can easily derive the analogous of a modern cartesian equation: as far as I remember, that was done for the first time by Apollonius of Perga in 3rd Century b.C. See here for a derivation in the case of a parabola and here for the same thing in the original by Apollonius (translation by T.L. Heath).
But of course in ancient times those equations were not regarded as fundamental, nor of course people realized that any quadratic equation would lead to a conic section: cartesian coordinates would appear many centuries later. On the other hand, often non-orthogonal coordinates were used. Moreover a cone, for Apollonius, was not necessarily a right cone: it was defined as a surface formed by the lines joining the points of a circle with a point outside the plane of the circle.
