Junk food isn't a specific dish, it's a verdict on what's in it: lots of energy, few nutrients. There's no official definition, which is exactly why people argue about whether pizza, döner or muesli bars count. Three terms help sort things out: junk food, fast food and ultra-processed. They mean three different things.
What is junk food?
Junk food is food with lots of calories but little nutritional value: plenty of sugar, fat or salt, and hardly any vitamins, minerals or fibre. The Duden calls it “poor-quality, unhealthy food”, and the DWDS dictionary says “food of low nutritional value but high calorie count”. That's as far as the definition goes: neither food law nor the specialist literature sets a sugar or fat content above which a food counts as junk food. Authorities work with nutrient profiles instead, such as the WHO Regional Office for Europe model, which is only used to restrict advertising to children, or the British abbreviation HFSS for “high in fat, sugar, salt”.
Why is it called junk food?
“Junk” means rubbish, clutter or ttat, and “food” means, well, food. So junk food is literally rubbish food, and the term is meant to be derogatory. The Duden spells it as one word, though “Junk Food” is just as common. It comes from the USA, where it appeared in newspapers by the 1950s at the latest and became popular in the 1970s through the consumer advocate Michael Jacobson. So it's a judgement, not a technical term. That explains why the line stays so blurry.
Junk food and fast food: the difference
Fast food describes how food is sold, junk food describes the quality of the food. The Duden defines fast food as a “quick meal”, so food that goes across the counter in minutes. It doesn't say whether it's nutritious. Plenty of fast food is junk food, but not all of it: a gyros in a pitta gives you 43 g of protein and raw veg. And not all junk food is fast food: crisps, gummy bears and fizzy drinks from the supermarket don't need a takeaway. The fact that the Duden still lists fast food as a synonym for junk food just shows how often the two overlap.