What's happening when you use "Pen" tool in Photoshop

Actually the "Pen" tool draws a Bézier curve on the screen. Moreover, all the curve that "Pen" tool generated is second-ordered, that means it use two anchors and at most four control points. The animation above show the process of the generation. White point is the starting point, the black is the ending while the rest is the anchor. Drag the points to see more features.