It works because browsers attach cookies automatically. Defences: SameSite cookies and a per-session token that must be sent in a header or form field.