It's a kind of a coding competition, indeed. The goals and the circumstances differ from a hackathon. The demoscene events are not for coding, although I'm sure it happens, but rather for showing off the work that was prepared beforehand. Usually these works are multimedia, so visuals and sound go together, but the main focus is the visuals, the rest of it is supportive. Works are nominated in different categories, which are usually set up to be very restrictive, for example, the work should be a single 32-bit Windows executable, no additional files, and the EXE should not exceed a certain byte size. The point of all this is to create the most impressive work within the restraints.
Wrt/ terminology, one submission of such a work is a "demo", and "demoscene" is the name for the culture itself (people, events, submissions, associated works like websites).
For an easy example, the all-time most popular work is this one: https://www.pouet.net/prod.php?which=30244 (according to the site's own ranking). You can download the software to run yourself, or you can watch a youtube recording of it, which is much more accessible. The entirety of this work (visuals, music) is compiled into a single 177k executable.