In singing specially classic music, what is the difference between when the legato is written and when it's not they all sound the same connected line?
The purpose of legato is to run one note into the next, without separation between them. Usually in singing this occurs most prominently in 'melismas' which are points when a single syllable is sung across multiple notes.
While there has to be some separation between syllables, you can still sing in a legato way, in which the gap between notes is reduced, and you sing in a flowing, joined-up way.
If it helps, the opposite is staccato, where the start of each note is emphasized and there's almost a gap for a breath between each note. Legato is as flowing and smooth a way as possible.
There's a bit of a more standard answer in the wikipedia page for legato (https://en.wikipedia.org/wiki/Legato):
In classical singing, legato means a string of sustained vowels with minimal interruption from consonants.
It also notes that for classical singing, legato is a default state, if you're not told to emphasize the attack part of notes, you run phrases together.
In Western Classical vocal music, singers generally use it on any phrase without explicit articulation marks