How does the second bullet point of the War Caster feat change the ability to cast spells while holding weapons?

The second bullet point of the War Caster feat reads as follows (PHB, p. 170):

  • You can perform the somatic components of spells even when you have a weapons or a shield in one or both hands.

Are you allowed to cast spells in the following situations without the feat:

  • when wielding a sword and shield?
  • wielding a two-handed weapon, such as a greatsword?

How does this change when you have this feat? For the two-handed weapon scenario, can you not simply hold the two-handed weapon in one hand and cast the spell in the other? Or is there a rule specifying you must hold a two-handed weapon with two hands even when you are not attacking with it?