There used to be Bus (every device on one wire) and Token Ring by IBM (a token goes around in a ring and visits every device), but today it is mostly a Star topology (many devices connected to a single central device, such as a Hub or Switch) A Hub simply repeats incoming signals to all connected devices. A Switch additionally prevents collisions by coordinating incoming and outgoing signals: It inspects incoming frames and stores the MAC addresses and the corresponding port of each device in an internal table. The next time a frame arrives the Switch can lookup the port and send the data directly to the device.
When the destination MAC address of a frame is all hexadecimal F’s. then the frame is duplicated by the Switch and sent out to all actives network interfaces (broadcast). That happens on layer 2.
A Switch can be connected to another Switches using two cables trying to improve performance, but this introduces the possibility of a broadcast storm: Broadcast messages are stuck between the two switches. The solution is to use an enterprise-grade switch with Spanning Tree Protocol which will identify redundant ports and shut them down.