Service Packs are collections of security updates and stability enhancements from Microsoft.
For Windows XP, every new Service Pack includes all fixes from previous Service Pack so that you don't need to download and install them one by one. Service Pack 3 is the last service pack for Windows XP because XP is really old by now.
Cybersecurity researchers have suggested the ransomware attacks are so potent because they exploit a a known software flaw dubbed Eternal Blue.
This Windows flaw is one of many zero-days which apparently was known by the NSA -- before being leaked by the Shadow Brokers hacking collective.
Microsoft released a patch for the vulnerability earlier this year - but only for the most recent operating systems.