What is the role of baffles in Fuel Tanks?
They help in keeping the fuel from sloshing around during maneuvering. Some sloshing is impossible to avoid, but a reduction is extremely helpful in avoiding unwanted dynamics.

Consider a sudden pitch-up into a climb, or a sudden acceleration when the afterburners are lit: Now the fuel will rush backwards, shifting the center of gravity backwards. If this happens suddenly and the fuel starts oscillating, the aircraft would fly a wavy flightpath without pilot input. Now add the input of the pilot who tries to keep the flightpath steady, which is delayed by maybe 0.2 seconds, and add the latency of the control system, and you might have ideal conditions for pilot induced oscillations.

Some combat aircraft don't use baffles, but a coarse, sponge-like foam which takes up maybe 2% of the tank volume but dampens fuel oscillations very effectively.