One uniquely identifies and the other classifies.
In the first case, it is nonsense to call two things to same thing.
In the second case it is common to want to give a group of things the same look and feel.
In the context of CSS, you should only rely on classes. Validators of CSS should balk at using ids for applying styles. You can still define a unique style used by only one distinct element.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…