Especially during turbulence, I notice that passengers are warned to sit and fasten seatbelts, but flight attendants continue to serve only cold beverages (since the overflow, slosh, spill of hot beverages would be dangerous), stand, walk, and work. Why? It appears unfair for flight attendants to suffer any more risk and danger, even if the turbulence is minor, than passengers.
I worked as a flight attendant for several years and I am still employed within the industry but in a different capacity, so I know a thing or two about this topic.
Flight Attendants (FAs) are strictly required to be seated during take-off and landings only and usually not during descent or climb, unlike passengers who are usually required to be seated and buckled. Then it depends on the local rules for how long they are supposed to stay there. In some airlines, the FAs must sit as long as the seatbelt sign is lit, while in others they can move about once the gears are up (you can hear this easily, as they make a loud sound when they are retracted). Other airlines might state FAs can move once the plane reaches a certain altitude and/or are given some sort of sign from the cockpit.
There is not one type of turbulence, but various classifications. Some of them are just light (small bounciness) and some are dangerous and can injure (or kill) people who are not seated and buckled. It is usually cabin crew who are the victims (I have personally been through this kind of turbulence).
Usually, pilots will, during the pre-flight briefing, brief the cabin crew of any expected turbulence and will usually say something like: "seatbelts are for everybody" or "seatbelts are for passengers". If things during the flight end up different from the forecast that was given to the pilots prior to the flight, the pilots will call the cabin crew and inform them. They will tell the cabin crew whether to continue the service because it is a light turbulence, they may suggest only to serve cold beverages, or tell the FAs to sit tight and secure everything if approaching severe turbulence.
This is basically the "secret" behind it. There is no magical training given to cabin crew on how to defeat the laws of physics and stand balanced while in turbulence; it is just the word from the pilots as they are the most knowledgeable about the weather conditions. The crew are only trained on types of turbulence and on how to secure the cabin and service carts quickly in case of sudden severe turbulence that was not detected in advance. In that case, they are told to hang on to anything and secure themselves.
Passengers, on the other hand, are required to be seated and buckled during all phases of the flight except cruise and when there is no turbulence. This is simply due to liability and not to add more complication in these critical times.
Flight attendants are quite used to minor turbulence. The average passenger is not, and could easily end up somewhere uncomfortable. Turbulence also has the habit of getting worse without too much warning.
FAs do buckle up once the turbulence reaches a certain level. I once departed Hong Kong during a typhoon - the FA sitting across from me said the crew was told to stay seated for 20 minutes after takeoff, and she'd never heard that instruction before.
It's about risk management. In minor turbulence, probably nothing bad will happen so it's OK to have a few people walking around but, in the unlikely event of a big bump, you don't want to have 300 passengers thrown around the plane. If the turbulence is bad enough, even the flight attendants sit down and put their seatbelts on.
In the U.S., the Federal Aviation Regulations (FARs,) specifically 14 CFR 121.317, only require that passengers be seated when the seat belt sign is on, not the crew.
(f) Each passenger required by § 121.311(b) to occupy a seat or berth shall fasten his or her safety belt about him or her and keep it fastened while the “Fasten Seat Belt” sign is lighted.
This is primarily for the reasons mentioned in paul and David Richerby's answers, namely, that the cabin crew is trained and experienced in walking through the cabin in light to moderate turbulence and that have 3 or 4 unsecured people is much less of a risk than 150 unsecured people. The very slight risk of a cabin crew member being injured during light to moderate turbulence is not seen to outweigh the benefit of cabin crew being able to continue performing their duties. As paul and David mentioned, the flight crew will still advise the cabin crew to be seated during take-off, landing, and more severe turbulence. For instance, in my experience at least, it seems that the cabin crew is usually advised to take their seats as the aircraft is entering or crossing a jet stream or operating near thunderstorms.