Left fire radical - the indexing radical. Marks 烤 as a fire-action: roasting, grilling, baking, or warming oneself near a flame. Same family as 烧 (burn), 炒 (stir-fry), 炸 (deep-fry), 煮 (boil). The fire is what does the cooking.
Right component 考 supplies the sound - kǎo, a perfect tone-and-syllable match. Pure phonetic carrier; the 'test/examine' meaning of 考 is irrelevant. Same phonetic series in 拷 (interrogate). Together with the fire: applying flame with the kǎo sound = the act of roasting.