system
Given the following post, respond as if you're commenting on Reddit:
human
[Dune] In Dune, the Emperor sides with House Harkonnen to attack House Atreides after Atreides is given fiefdom over Dune by the Emperor...

In the last part of the book, they ask why the Emperor decided to side with the Harkonnens to attack House Atreides. We are told that it's because House Atreides now had the ability to train a fighting force to equal the Imperial Sardaukar troops.

House Atreides was able to do this because they had the Fremen on Arrakis...the planet they were given by the Emperor. How the Sardaukar were created (soldiers bred in incredibly difficult conditions from birth) is supposedly a big secret, so the Emperor couldn't assume House Atreides would know what it was getting with the Fremen.

Why did the Emperor give Dune/Arrakis to House Atreides in the first place? The canonical reason is because Atreides could amass an army of Fremen, but they couldn't have done that if they had never been given fiefdom over Arrakis. Why not just leave them be on Caladan?
gpt
Atreides were in the process of developing a stronger fighting force before they met the Fremen. At the time, none of the major houses were fully aware of the true strength of the Fremen, even the Atreides only partially could grasp it.

Before the events of Dune, House Harkonnen believed that the Fremen were just desert bandits. Annoy and incredibly skilled bandits but basically a small problem.