Some good points here.
Basil does indeed like to be pinched back, or it does get leggy very quickly. Not to mention it will race toward flowering, at which point the plant starts to turn woody (as in the stems go from the tender green phase to actually becoming woody and difficult to pinch), which will impact the flavor of the leaves.
Basil does not favor going to bed wet. Obviously, storms at night cannot be helped and are part of the equation, but any watering should be done earlier in the day so that the soil is, ideally, not too wet during night time.
Sun is definitely a huge factor. More is better. That means if you have a choice, a South facing window is the best bet. In the yard, plant where the most sun hours per day are available.
Finally, the soil can be an issue. Especially for potted plants, people may tend to plant in much too rich a soil. This could be the case outside as well. While the addition of some organic matter is not a bad thing and preferable to regular fertilization with liquid mixes, cutting in some sand into the mix helps keep the soil from becoming too nutrient rich and also helps with drainage....as many species of basil do not like wet top soils.
It's not exactly the same, but think of it a little like vines for winemaking.....the best wines are produced from grapes which have been significantly cropped back to reduce the amount of grapes which a single vine will produce, the vines are planted in close proximity to each other so that roots are forced to grow more straight downwards to avoid competition from neighboring vines (and this taps into deeper lying water and any minerality specific to the soil (the terroir so to speak) and are generally planted in poor soils....shockingly poor in some instances (as in right into solid stone in some places), which again forces the roots to go downwards. Such "under stress" vines send all of their energy into a smaller amount of fruit instead of being dispersed into many grapes....resulting in grapes with a more concentrated, potent juice content. Avoidance of a dilution effect.
Basil is similar. By "pinching" off on a regular basis (not too aggressively, you obviously need leaves for photosynthesis), not planting in too rich a soil and not overwatering, the oil content of the leaves is better maintained, which makes for a more flavorful leaves. --K