Generally speaking, the CAI plays off of two principles:
Colder air means the air density is greater, which translates into more O2 in ppm than less dense air. Technically speaking, the greater ppm of 02, the more powerful the combustion stroke is. So theoretically, by positioning the intake filter outside of the engine bay (where the ambient temperature produced by the heat of the engine does not heatsoak an otherwise internally located filter), a CAI consumes a slightly less warm charge (more dense).
The second principle aftermarket intakes (that are made of aluminum) play off of is the lesser coefficient of air to piping surface friction of polished aluminum-air than air-plastic. No matter how negligable, there is less friction. Thus the velocity of the charge moving to the head is greater. A higher velocity charge means air is more efficiently available to the head. Inner diamter of the intake piping is also a factor in charge velocity. Generally speaking, with a constant charge density, the narrower the diamter the higher the velocity. The wider the diamter, the lower the velocity. However, finding a balance in this is key. You don't want the inner diamter to be so small that it's restrictive, but you don't want it to be so wide that the air flow velocity goes to s***.
The third principle ANY effective intake should take into account is the path of the charge. Simply speaking, any charge (regardless of the density) flows with less restriction along a straighter and shorter pathway. The straighter and shorter the path, the more air is efficiently available to the head at any given moment.
Designing an intake that fulfills all these principles is a balancing act. Mazda tries to do this, but with alternative motives in mind-- noise reduction and fuel efficiency.