Which portion or portions of the nervous system contains afferent and efferent neurons?
The body has 2 main nervous systems - the Central Nervous System and the Peripheral Nervous System. The somatic system is associated with the Peripheral.
The reason we have 2 systems is because the brain doesn't need to be involved in every little thing we do. It has things to think about and contemplate and really doesn't need to be involved in dealing with things like pulling our hand off a hot burner on the stovetop (but it will want a full report of how said hand ended up on said stovetop). And so the pulling the hand off the stovetop is part of the somatic system (where a sensation goes to the spinal cord and a response shoots back) and that full report will go along the central nervous system where it will take stock of the damage, record the sensations, and decide what needs to be done in the short term (cold water and ice) and longer term (a trip to the hospital perhaps).
The somatic system sends messages to the spinal cord via afferent nerves and the response runs back along efferent nerves.