Raising preflop reduces the field your hand has to play against. The less opponents you have, the more likely your strong hands will hold up.
If we take AA for example, against 1 opponent, it has ~85% chance winning against any random hand. However, against 6 players, the chance of winning drops down to ~43.5% chance. And against 8 other players, it drops to ~35% chance of winning.
So, with the best hand, you rather play against fewer player since since the you have the better chance of winning the pot.
Raising preflop also gets you value for your big hands. With big hands like AA and KK, you want to get as much money as you can in the middle while, at the same time reducing the number of opponents you play against. This way, you win bigger pots (more money) and you give yourself the best chance of doing so going against fewer opponents.
Lets say you have AA and you let 8 other players limp in for a $1 each. So, there is $9 in the middle. Against 8 players, AA only has a ~35% chance of winning by the river. To simply things, we'll say you're winning 3-out-of-10 times.
So, if we play this scenario 10x in a row, you're winning the $9 in the middle 3x for $18 total. Subtracting the $3 you put in, you're making $15 in profits for you wins. The other 6 times you lost, you paid $6 total, so $15 - $6 = $9 in total profits.
Now, lets say we play the same thing but this time you raise it $5 and get 3 callers. Vs 3 opponents, AA has a ~64% of winning by the river. Again, to simply things, we'll say you're winning 6-out-of-10 times.
So, with 4 players in the hand, the pot is $20 and with a ~64% chance of winning, 6 x $20 = $120. You paid $5 x 6 or $30. So, $120 - $30 = $90 in profits for the times you win. The other 4 times you lose, you're paying $20, so $90 - $20 = $70 in total profits.
So, the exact same scenario of playing AA 10x in row, you increased your overall value (money made) and also increased your chances of winning by raising and thinning out the field.