You have misinterpreted your diagram. The lumbar nerve roots come off the spine and join into multiple nerve plexuses. There are many diagrams out there that demonstrate what other nerve roots L4 combines with, what muscles it controls and lower extremity function. The information below was taken from:
http://www.neuroexam.com/neuroexam/content.php?p=29
You should be able to do a Google search and get a better understanding that L4 doesn't end, it combines with other nerve roots for function of lower extremity muscles.
Lower Extremity Strength Testing
Action Muscles Nerves Nerve Roots
Hip flexion Iliopsoas Femoral nerve, and L1-L3 nerve roots L1, L2, L3, L4
Knee extension Quadriceps Femoral nerve L2, L3, L4
Knee flexion Hamstrings (semitendinosus, semimembranosus, biceps femoris) Sciatic nerve L5, S1, S2
Leg abduction Gluteus medius, Gluteus minimus, Tensor fasciae latae Superior gluteal nerve L4, L5, S1
Leg adduction Obturator externus, Adductor longus, magnus, and brevis, Gracilis Obturator nerve L2, L3, L4
Toe dorsiflexion Extensor hallucis longus, Extensor digitorum longus Deep peroneal nerve L5, S1
Foot dorsiflexion Tibialis anterior Deep peroneal nerve L4, L5
Foot plantar flexion Triceps surae (gastrocnemius, soleus) Tibial nerve S1, S2
Foot eversion Peroneus longus, Peroneus brevis Superficial peroneal nerve L5, S1
Foot inversion Tibalis posterior Tibal nerve L4, L5
When more than one nerve root participates in an action, emphasis indicates the most important nerve roots.