Junction boxes are primarily used for identifying where the Junctions are in a wiring circuit hence the name - Junction Box - ( or JB enclosure) and also to keep rodents out, and act as a support points for interconnecting cable conduits. They also act a neat way to cover numerous wires into a common point or junction. That is about all the cheap plastic white or grey ABS boxes do in most building installations.
Junction boxes are more common in electrical systems, rather than electronic ones. I personally see an anomaly here as both systems try to keep the number(s) of joints and / or connections, to the minimum required. The link that is mentioned is more for electrical systems, rather than for electronic ones - most electronic connectors / junction boxes will be mostly factory made (in totality); with plug in, screw in and / or soldered connections, as electronic systems operate at lower voltages and data / video / audio signals also need screening.
With the change to concealed wiring, the use of junction boxes have increased (as also outlet, pull, and similar boxes / enclosures). They are generally meant for joining and distributing a 3 set of wires. or more. If required, they will have connector blocks and earth lugs / connections. All this is to ensure that connectivity, safety in operation and for ease of maintenance is available. They also provide protection to the joints and connections.