I have read that in a p-n junction, free electrons from n side diffuse to the p side and then recombine with the holes of p side. Here, it does not refer regarding energy bands. However, free electrons must be electrons in conduction band and hole must be in valence band. If free electrons recombine with the holes, they are degraded to the valence band from conduction band. For this, they must lose energy. So my question is "Do they really lose energy? If so, how?"
Wait! Before pondering about this, I have another question related to this question. It's due to this question, I came up with the above question. In p-n junction, if we have a look at the valence band, in case of p side, the valence band has more holes and less electrons whereas in case of n side, it has very less holes but more electrons. So don't electrons diffuse from valence band of n side to p side? My understanding says they diffuse as they are going to have lower energy when they are distributed evenly. So why shouldn't they? (Of course, before the barrier potential has been reached.)