Reason for the formation of azeotropes
Before getting to the azeotropes, it's worth reminding ourselves of the relevant assumption that we make about ideal mixtures: that the intermolecular interactions have constant energy regardless of the mixture. 

Given the important role that intermolecular interactions have in determining the boiling point of a pure liquid, it's surprising that so many mixtures behave approximately ideally, in line with this assumption. There are two main reasons for this. 

First, liquids are only miscible if they have somewhat similar types of intermolecular interactions with similar magnitudes of energy. For example, water and hexane have very different intermolecular interactions, so surrounding water with hexane or hexane with water is quite unfavorable, and the two do not mix. Thus, any actual mixture has interactions between the two types of molecules that are not hugely different from the interactions within the pure liquids.

Second, substances that are liquid are room temperature generally do not have especially strong intermolecular forces, so the small differences in the intermolecular interactions of two miscible liquids is usually dwarfed by the impact of the difference in molecular weight that is a major determinant of boiling point. Water is quite unusual in having such a low molecular weight and still being a liquid at room temperature, a symptom of the exceptionally strong role of intermolecular interactions in determining its boiling point. 

With that in mind, we can talk about azeotropes. To get a minimum boiling azeotrope, the deviation from Raoult's Law requires that the vapor pressure of the lower boiling component be reduced from what is predicted for ideal behavior and that the vapor pressure of the higher boiling component be increased. In order for that to happen, we need two liquids with substantially different intermolecular interactions whose mixing changes those interactions in opposite directions.

In the example of the water:ethanol azeotrope, the water is able to increase the amount of hydrogen bonding between ethanol molecules by increasing the density of hydrogen bond donors and acceptors per unit volume. At a low water concentration, the water also does not interfere greatly with the hydrophobic interactions between the ethyl ends of the molecules. As a result, the average intermolecular interaction for the ethanol molecules is stronger than in pure ethanol, and we have the necessary decrease in the vapor pressure of ethanol. For the water, when it is at low concentration in mixture, each water molecule is surrounded by ethanol molecules, so it has fewer hydrogen bonding interactions than in pure water. As a result, its average intermolecular interactions are weaker than in pure water, and we have the necessary increase in vapor pressure. Many low molecular weight alcohols form azeotropes with water for the same reasons. 

When the water concentration gets below what is required for the azeotrope, enough of the alcohol molecules interact only with other alcohol molecules that the deviation from ideality decreases.

For the maximum-boiling azeotropes, the requirement is that the vapor pressure of both components is decreased. This is quite common in acid:water mixtures where the degree of ionization of the acid in the mixture is higher than when it is in pure form, which means that there are more ionic interactions, which are quite strong. If the water concentration gets below what is required for the azeotrope, the amount of ionization decreases and the deviation from ideality decreases with it. When the water concentration is higher than in the azeotrope, there may be a great deal of ionization of the acid, but there is enough water that is not interacting with the acid (and conjugate base) molecules that the deviation from ideality is less.