They had no other choice.
The technical foundation of the prior WP versions (aka, Windows CE) was just too dated and they didn't have a Windows kernel / userland capable of performantly dealing on ARM, x86 performance was and still is utter dogshit on battery powered devices, they didn't have a Windows userland actually usable on anything touch based, and most importantly they did not have developer tooling even close to usable.
At the same time, Apple had a stranglehold over the upper price class devices, Android ate up the low and mid range class - and unlike the old Ballmer "DEVELOPERS DEVELOPERS DEVELOPERS" days, Microsoft didn't have tooling that enticed developers, while Apple had Xcode with emulators that people had been used to for years, and Android had a fully functioning Eclipse based toolchain.