I only apply to companies I really, really want to work for. Might sound a bit kitsch, but I work a lot on my cover letter to show how eager I am to work with them.
Of course it could be luck, but so far I wrote only two applications in my life and got both got accepted + for job offer from both (after interviewing).
When I tell people about my cover letters some say that HR don’t even read cover letters, but I want to believe otherwise :D