A wedding could be organised quickly, the legal requirement was for banns to be read 3 consecutive weeks.
Not well informed young women can be pregnant for a while before they realise, hence 'I didn't know until I went into labour' stories. Or wise gran might have her waiting for missed periods. Suppose she showed at 20 weeks. In rural & working class areas, a wedding at 24 weeks with a careful choice of clothing wouldn't be unusual. Kid legally 'legitimate'.