It's pretty simple - and rather pointless, really.
You pass it text based parameters and it converts them to valid SQL WHERE condition as a string.
So you use it:
[dbo].[udf_GenerateWhereQuery]('AND', 'nameOfColumn', 'gte', '666', 'numeric')
And it returns
'AND nameOfColumn >= 666'
Which would I rather read in my code? Not the function call...
The only advantage of this is that it can take values from a DB and generate SQL that can be executed - but that's dangerous as it leaves you open to SQL Injection.