A switch in a Local Area Network (LAN) is a hardware device that connects multiple devices through a process known as Switching which happens at the Data Link Layer (Layer 2) of the OSI layer. Data Link layer is where a system starts placing data in the transmission medium (wired or wireless) by adding a Source and Destination Hardware address. Using this hardware address a switch forwards the frame to the target system. The actual transmission happens in the physical layers where the frame is converted into bits.
The switch does switching of the frames using Application Specific Integrated CircuitĀ (ASIC) between the systems like desktops, servers etc that is connected to it. A switch has collision domain and broadcast domain. Every switchport is a collision domain. A switch itself is a broadcast domain and using Virtual LAN (VLAN), switch can have multiple broadcast domain.