When the switch initially starts up, all switch ports become a member of the Default VLAN (generally all switches have Default VLAN, named as VLAN 1), which makes them all part of the same broadcast domain. Default VLAN allows any network device connected to any of the switch ports, to connect with other devices on any other switch ports.
VLANs (Virtual LANs) are the logical grouping of devices or ports in the same broadcast domain. VLANs are configured on switches by including a few interfaces into one broadcast domain and some interfaces into another.
A VLAN acts like a physical LAN, but it allows hosts to be grouped together in the same broadcast domain even if they are not connected to the same switch. So VLANs can be spread across multiple switches, with each VLAN being treated as its own subnet or broadcast domain. This means that frames broadcasted onto the network will be switched only between the ports within the same VLAN.