Tire valve caps are the final seal again potential failure in the valve of the valve stem. A good tire valve cap will come with high quality rubber seal that push against the circumferential 'ring' of the valve stem and thereby help to contain the air should the valve fail or not containing the air very well.
You observation of your tire (the one with the missing cap) losing air confirms that this could be a possibility.
Of course, the other possibility is that your tire is having a slow leak - go to any petrol station, and it could be rectified at a minimal cost.
Note: Even if the valve is perfectly good, if the tire go over a bump or pot hole, it is still susceptible to lost of air due to the additional pressure asserted during the hit.