IP spoofing involves modifying source IP addresses on IP packets to gain unauthorized access to machines. It is commonly used in denial of service (DoS) and distributed denial of service (DDoS) attacks to overwhelm servers and crash networks by sending a flood of packets without being detected, as the true origin cannot be identified due to the spoofed IP address. While spoofing poses real risks, defenses include packet filtering, firewalls, and cryptographic protocols.