In many cases when a government branch or municipality switches away from Microsoft, Microsoft throws money at the government branch or municipality.
For example, When Munich in 2013 migrated to Linux:
"In 2016, Microsoft relocated its German headquarters to Munich. "
"In 2018, journalistic group Investigate Europe released a video documentary via German public television network ARD that claimed that the majority of city workers were satisfied with the operating system, with council members insinuating that the reversal was a personally motivated decision by mayor Dieter Reiter. Reiter denied that he had initiated the reversal in gratitude for Microsoft moving its German headquarters from Unterschleißheim back to Munich."
For example, When Munich in 2013 migrated to Linux:
"In 2016, Microsoft relocated its German headquarters to Munich. "
"In 2018, journalistic group Investigate Europe released a video documentary via German public television network ARD that claimed that the majority of city workers were satisfied with the operating system, with council members insinuating that the reversal was a personally motivated decision by mayor Dieter Reiter. Reiter denied that he had initiated the reversal in gratitude for Microsoft moving its German headquarters from Unterschleißheim back to Munich."
https://en.wikipedia.org/wiki/LiMux