Top switch will activate hi-lo circuit with running lights. The connected 2 position switch will activate either high beam or low beam.
The lower switch will activate only the running lights.
The relay is used to stop voltage from back feeding into the headlights when only the running lights are activated.
This is a very simplified circuit that you would find in Heavy Highway trucks. Most passenger vehicles have a single switch that performs this same concept.