Here is a simple hand situation showing how play varies due to stack size. You are in a NL Holdem game with $1/$2 blinds. You are in the small blind with no action yet. You have $500 and hold 4,4. The player that's the big blind has only $25, so you can simply go all in or make a bet and push after the flop. This should make you money.
But, let's say the big blind has $500. Then going all in would be a very risky play. Although you would win the blinds most of the time, you will also lose most of the time when you get called. Who wants to risk $500 to win $3?
How about this. Would you put $100k in there for the $3. If the only hand that calls you is A,A (1/220 times), this is what happens. You win three dollars 219 times and then, bam, you go broke.
If your opponent played the same way with his $25 you'd be very profitable. Even if you never won when you were called, you get $657 for every $26 that you lose.
Now, you get 3,3 and have a $500 stack. The game is still $1/$2 and you just call. THe big blind chooses to raise to $10. His stack makes all the difference in what you will do.
Against his $15 chip stack you could argue for any option. So, now you go by what you know of this players game, to determine a move. With $40 you can fold pretty easily.
You only get your three of a kind 12.5% of the time and the max payout is only five times if you can even get an all in call. A $500 stack means you need to call or maybe even raise. With either play you can get enough value from the hand when it goes right.
When you have hands like 6,7 suited, you want to be playing with "deep stacks". This means everyone has a lot of chips. You can call raises because you will get "paid" when you hit with this type of hand. With small stacks, you can't make enough money to make up for all of the losses you will incur.
With A,A or K,K you will find yourself in some difficult situations when players have lots of cash. It's very hard to know if these pairs are still good, so you will find yourself paying off people who hit the flop.
If we turn this around the A,A and K,K hands do great in the short stacked situations. With preflop betting and a good hand you will rarely fold. These are pretty routine conditions to play.
Now you should see why everyone is affected by stack sizes. When you get many different stack sizes at once, it gets tricky. Still, you have to sort it out to the best of your ability to make the right play.