What to do if I don't understand the related work? I am writing a master's thesis in Computer Science. It's the first document I write, so not much experience. 

My supervisor told me to include some previous/related work on the topic I am writing about. In short, it is about computing influence in social networks. I have found about 10 papers which I think are the most relevant ones.

The problem is that, while the topic and goal are the same as mine, the math/algorithms they apply are often way different than mine, and advanced enough that it would take a lot of work to truly understand them. So in other words, I want to somehow argue why my model makes sense and not others, but at the same time my work is not directly based on others.

The question is, can I write about it even though I don't understand it? How well am I supposed to know the previous work I am writing about? Is it enough to have some intuition?

Sorry if this is obvious, but my university do not teach us how to write (I guess one point of having a Master's thesis is to learn these things).
The thing that strikes me most about your question is "the topic and goal are the same as mine". If this is the case, then those papers are intimately related to yours, and you will want to understand them for your own good. Granted you might not have the time - it is a Masters thesis after all. However, you'll still want to compare and contrast their results against yours. After all, a big question to answer is "is my method better than theirs?" and you cannot answer that question without knowing how the methods stack up.

You don't have to fully understand another work to write about it, but you might not be able to go into much detail: for example "Alice and Bob (2019) have also studied this problem using [method], but they ran into [issue] which we do not have" is perfectly fine. Nonetheless, with ten intimately related papers I think you will want to discuss this with your supervisor. That's a lot of related work, and your professor might already be aware of some/most of them. He might give you direction on which papers to write about, which to read in more detail, and so on.