Why Were Cellphones Locked?
In the early days of the smartphone, especially around the release of the iPhone in 2007, cell service providers entered exclusivity deals with electronics makers in an effort to tempt more people into signing with their networks. Apple, for instance, signed a deal with AT&T, so that first iPhone, and a handful of future iterations, could only be bought at AT&T stores and paired to their network.
To compete, other major providers started scooping up their own exclusives, such as Motorola's Droid, which was only available at Verizon. For those years, the networks held a tight grip on these contracts, not allowing customers to take their already purchased phones to other services.
In response to SIM locking, a lot of iPhone users installed slightly shady "jailbreak" software on their devices to manually unlock them and allow them to receive third party SIMs. This practice would fall by the wayside around 2011, when Apple ended its exclusivity contract with AT&T, ending the perma-locked iPhone along with it. Another win for consumers came in 2015, when the United States Congress ruled that service providers were legally obligated to provide a reliable method of unlocking their phones.
While carrier exclusive devices still exist, they are no longer permanently tied to their home networks, and are typically allowed to go free after a few months of service. The relative ease of this process also means that pre-unlocked phones can now be found in both new and used condition through online sellers and retail stores. These devices will accept any compatible SIM right out of the box.
If you're traveling in Europe you can either get an international plan with your U.S. carrier or buy a SIM card when you land in your destination which will let you access local phone coverage.