When two straight lines intersect the vertically opposite angles are equal.
But, can we say that, if the vertically opposite angles of two lines are equal then the lines are straight?
The angles marked equal in orange, come after comparing the two congruent triangles, in the attached image.

As your attached image shows, having a pair of opposite angles that are equal is not enough to deduce that you have two straight lines - angles $\angle AED$ and $\angle BEC$ are shown to be equal, but even visually you can see that AC and BD are not straight lines.
However, if both pairs of opposite angles are equal - so in the diagram, if we also had $\angle AEB = \angle CED$ - then since the angles around a point sum to $360^\circ$ we can note that $\angle AED + \angle AEB + \angle BEC + \angle CED = 2(\angle AED + \angle AEB) = 360^\circ$ and so $\angle AED + \angle AEB = 180^\circ$ which is sufficient to prove that BD is a straight line, and similarly for AC.