Companion planting

Does companion planting actually work? Why don't the lists agree? The science behind which plants help each other, and which ones don't.