I can take a thick case iron frying pan and heat it on the stove until oil smokes. I do this regularly to season it. The heat is high. Temperature gradients are high. But the frying pan never warps.
On the other hand, a baking tray in the oven sometimes does warp. An oven isn't perfectly uniform, but it it is more uniform than sitting directly on a stove top. Even with food holding temperatures down in some parts of the baking tray.
I would expect the same types of thermal expansion problems in both. I would not expect phase transformations in iron or steel at these relatively low temperatures.
So what is going on that makes an irreversible change in shape in a thin baking tray, but not in a thick frying pan?
Update
Heating either pan uniformly would produce a uniform expansion with no warping. Temperature gradients would be expected to create non-uniform stresses that could warp a pan.
One question is why does the pan not return to its shape when the temperature gradients even out?
One might suspect annealing and/or quenching. Non-uniform expansion develops at high non-uniform temperature. These create non-uniform stresses that then relax. Cooling the pan quickly produces contraction and reverses the stresses. But they cannot relax at the lower temperature. So some part stays permanently longer than it was originally.
But what mechanism would allow annealing? Some phase change? Crystal grains in some favorable orientation growing at the expense of others?
As comments and @nielsnielson's answers say, a thin pan is easier to bend. Strength goes as thickness squared. So a smaller gradient should produce a noticeable warp.
A bend can mimic a greater thickness. Often a baking sheet has a flat bottom with a raised and rolled edge.
One common warp is for a baking sheet to become potato chip shaped. It rests on two corners. You can gently twist it, and it will pop to a configuration that rests on the other two corners. This suggests that the bottom is no longer a flat $2$D space. It has a negative intrinsic curvature. A circle drawn on the bottom would have a circumference $> 2 \pi r$. A rectangle drawn near the perimeter would have sides longer than $2 (l+w)$. Or perhaps the rim is elongated. This isn't the same as a bend that got "frozen in".
I have also seen baking sheets that become a bit bowl shaped. This suggests a positive curvature.
If a cast iron pan doesn't bend, it must mean that the stresses are smaller. That is, temperature gradients must occur over larger distances.
A baking sheet can get up to perhaps $450$ F $=230$ C in an oven. It might have a thickness of $1/16$th inch or $1.5$ mm. If dunked in cold water, it could have a temperature gradient of about $130$ C/mm.
When I season it, my frying pan rests on red hot heating coils. This implies the coils are perhaps $700$C. The pan doesn't glow, so it must stay below $500$ C. Canoloa oil begins to smoke around $200$ C. I don't quench it in cold water. I let it cool on the stove when I season it. I measured my frying pan as .2 inches or $5$ mm thick on the bottom. So the temperature gradient is maybe $60$ C/mm.
As I measured the frying pan, I also noticed it isn't flat on the bottom. It is a bit bowl shaped. Over a $6$ inch circle, the center is perhaps $0.05$ inches too deep. Unless the pan was warped when new, many years ago, this lower gradient is also enough to warp a pan. And the idea of annealing/quenching doesn't look as promising as I thought.