Difference between CTFs and Hackathons?

What is the difference between CTF and Hackathons or are they same ?

hackathon is like CTF but you gather with many people in a place and other people give you clues etc.

If I am correct, sometimes they give you some machines to hack like phones etc.
Like in Defcon there were some companies who gave a sample of election machine to test their security (but it’s not really like this in hackathons)