You can understand that the x\y\z in 2p refers to the direction of the x\y\z axis of the space coordinate, and all your previous understandings are correct.
If you are a high school student, I suggest you don't dwell too much on the book material structure. Many of these contents are guesses in themselves, and some things even chemists can't explain. You just need to master the rules and solve the problem. For example, the single bond must be suitable, the double bond is suitable and π, and the triple bond is suitable and π.