Blood passing next to the alveoli has just returned to the lungs from the rest of the body, so it contains lots of carbon dioxide and very little oxygen
When the blood reaches body cells, oxygen is released from the red blood cells (where there's a high concentration) and diffuses into the body cells (where the concentration is low)