No outside force permanently takes over the Shire. The hobbits reclaim it themselves.
After the Ring's destruction, the hobbits return to find Saruman's ruffians ("Sharkey's Men") occupying the Shire—industrializing it, cutting trees, and imposing harsh rules. This occurs in the book's final chapters (omitted from Jackson's film).
The Shire faces temporary occupation, not conquest. Its sovereignty is never ceded—the hobbits' resilience and combat experience (gained on the quest) enable their own liberation.