cars and scooters in a road bike race I see this a lot in videos from road bike races. A lot of rider team cars mixed with the road bikes doing the actual race.

What is the matter with that? What do they do? Also, don't the riders inhale all the fumes from the exhausts?
Motorcycles are mostly used for media (video and photos) and sometimes for support (they can have a limited number of wheels; I'm not certain if they are "neutral" or team specifics.

The motorcycles will be mixed in with the cyclists; the drivers are highly skilled.

The cars are for race support; there are team specific cars with spare parts and replacement bikes in case of breakage, and have team coaches and also used to transfer food and water bottles to the cyclists.
I think there are neutral cars with spare wheels (maybe dependent on the particular races)

There are also neutral cars with doctors and race officials and VIP.

Most of the cars stay behind the cyclists; if there is a breakaway a car will (as safely as possible) stay with the breakaway.

As for the fumes; at the speed they are going, it is not an issue; and since there are only a few motorcycles mixed in the cyclists, I don't think it is an issue in itself; and the majority of the cars are behind the cyclists.