Food is made up of all sorts of chemicals. Cooking just heats up those chemicals to make them change in some way.
Think of an egg egg – when eggs are raw, they’re all runny and gloopy. They wouldn’t be very tasty next to some bacon – yuck! As it heats up, you can see the transparent white is changing… and the yolk is getting hard.
There are long chains which are proteins – and the links are amino acids. Heat maked the chains break and reconnect in a different way. It changes pretty quickly!