I took a look under the hood of my friend’s car and saw this colorful coil:
What is this?
It's part of the exhaust. Most likely it's part of the exhaust gas recirculation (EGR) system. The part you are pointing out is a part which allows a bit of flex without any damage coming to the tube as a whole.