There are vew diffents on both layers. Each layers have their own basic functionality.
Layer 2 switches forward ethernet frames based on MAC address(From Phsyical Layer). Layer 3 switches forward IP packets based on destination IP address.
Layer 2 switch only inspects the Ethernet frame (i.e. MAC source/dest address) when 'routing' traffic to other ports. Suitable for connecting devices in a LAN. Layer 2 work on Data Link Layer.
Layer 3 switch inspects IP header (i.e. IP source/dest address) to determine routing. Suitable for connecting a larger network to segment traffic between LANs. More expensive and difficult to configure than Layer 2 switch. Layer 3 on Network Layer.
A switch works with MAC addresses at layer 2 of the OSI 7 layer model, and a router works with IP addresses at layer 3 of the model.
Pace of Layer 3 switches is considered much slower than Layer 2 switchs.
Thats not entirely true. The first packet in a routed stream will be forwarded slower than switching based on MAC address. However most multilayer switches support wirespeed forwarding of sequencial packets in a stream (after the initial routing decision is made).
Although the OSI model will explain where the term layer 2 and layer 3 came from, it won't explain what layer 2 and layer 3 switches are. As previous posters stated, switches use layer 2 while routers use layer 3. But that's the standard switches we use which is now called layer 2 switches. Layer 3 switches, on the other hand, are newer switches that has hardware integrated routing functionality. Lacking the WAN capability of routers, it's specifically designed to improve local network performance.
I agree with you froix but it can provide an anlogy and can help to better understand the concept of layers.
Layer one is for switches and packets. Where did it come from and where is it going? This is one step up from a hub, where everybody talked to everybody else.
Layer two is for route processing. I know where the information is going and coming from, but now I want to find the fastest route there.
Layer three is for intelligent network services. I know which route, but now I care about what. This layer gives priority to Voice over IP or video to reduce and prevent dropouts. This layer is application-sensitive.