Ethernet cables, e.g Cat5, Cat6 etc., use an 8-pin RJ45 connector on each end. When connecting a computer's Ethernet port to a device such as a switch or router, you would use a straight-through connector. That means pin 1 at one end is wired to pin 1 at the other end, pin 2 to pin 2, and so on.
But when connecting two computers together without a switch or router in between you need a special cable, called a crossover cable, that has the transmit wire pair swapped with the receive wire pair.
If you have Gigabit Ethernet, it has a technology called Auto-MDIX that automatically detects whether straight-through cable or a crossover cable is being used and automatically configures the Ethernet interface to use that cable.
More Networking Basics:
• Virtualization For Dummies Cheat Sheet
• Packet Switching Store-and-Forward Transmission
• Synchronous, Asynchronous, Isochronous. What Does it Mean?
• Network Administrator Street Smarts: A Real World Guide to CompTIA Network+ Skills
• Network Servers
• What is Cloud Computing?
• What is a Network Sniffer Used For?
• Computer Number Systems Made Simple
• Network Classifications: LAN, WAN, WLAN, SAN, MAN, and PAN
• Networking Foundation Topic - Routing