Bubble Sorting Along with Comparator Function

So I was watching this video on Bubble Sorting with the use of Comparator function, and I learnt how to pass a function as an argument to another function. But I wanted to ask that why is there a need to pass the function as an argument?
Can we not directly just call that function inside the other function?
I mean can we not call a particular function inside another function without passing it as an argument to that function?

hello @priyam04

we can always call one function from other function.

here to make things generic we are passing a function as an argument.