What's the difference between a recommender system and a decision tree? We learned in Machine Learning that both of those techniques try to predict an output (whether person A likes a specific product or whether person A has a high default risk) based on data of other customers. But what exactly is the difference? Or are both the same and they are just synonyms for each other?

I'm not sure why would you like to compare a decision tree in particular with a recommender system, so let me answer a more general question: what is the difference between machine learning and a recommender system?. Recommender systems can but don't have to use machine learning. For example, you can recommend your users the product that is currently most popular ("trending" on Netflix), or say that you have a music streaming app, your user Bob listens to Johnny Cash a lot, so you would be recommending him other albums of the same musician, or other albums from the same genre, if you bought a toilet seat, maybe you want another one? This is not machine learning, though machine learning can be a part of it.
Another difference is in the nature of the data and the problem. In recommender systems, you want to recommend a specific item to a specific user, where you have partial information on both. Not every user bought every item, and not every item was bought by a particular user. Your data is sparse, there is a lot of unknowns and your task is to fill in the gaps (would this user like this item?). In machine learning, your task would rather be to recognize patterns that you saw in the training data.
This is best illustrated with matrix factorization, the classic recommender system algorithm, that predicts the matrix of rankings $R$ using the characteristics of the products $P$ and users $Q$,
$$
R \approx PQ
$$
where $P$ and $Q$ are considered as latent (unobservable) variables. Considering this interaction is pretty specific for recommender systems. As said, recommender systems can use machine learning to solve this problem, matrix factorization is one of such algorithms, but there are also specialized neural networks borrowing ideas from it. Finally, there are specialized algorithms and metrics used for recommender systems, treating this exactly the same as standard classification wouldn't usually work well.
