Each nerve in the leg has a job. When one is damaged, the missing movement tells you which nerve it is.
The femoral nerve extends the knee, and the obturator nerve adducts the thigh. The common peroneal nerve dorsiflexes and everts the foot. It is injured by a fibular neck fracture or a tight cast, causing foot drop. The tibial nerve plantarflexes the foot. The superior gluteal nerve abducts the hip, so injury (for example from a misplaced IM injection) gives a positive Trendelenburg sign. Compressing the lateral femoral cutaneous nerve causes meralgia paraesthetica.