Incidental lottery
The raffle at the summer fete is a lottery in law. It escapes licensing only through a specific exemption with specific conditions.
The conditions restrict when tickets may be sold, when the draw may take place, what deductions may be made, and cap prize values. Selling tickets in advance, or drawing after the event has finished, takes the raffle outside the exemption.
If you cannot meet the conditions, you need a small society lottery registration with your local authority instead. Promoting a lottery that is neither licensed nor exempt is an offence: see running a lottery lawfully.