Great question — answering as the UphillTech team:
From your drawing it looks like the Cable 1 (14/3) is the one that switches light and Fan. However conecting all wires on cables 2,3 and 4 all together is a strange approcah. If the cable 4 is the main (brining power in) then what is the purpose of the cables 2 and 3, unless they extend the power to other places. If you disconnect 2 and 3 what is not working ?
Full answer by DIY75: https://diy.stackexchange.com/a/263805 (CC BY-SA 4.0).
Need it done for your business? UphillTech.