It is used when you have a Selfreference (an association that points to its own entity), to specifify whether you want to travel down the association (retrieve the children) or travel up (reversed) to retrieve the parent.
There are several forum posts about it, for example see https://forum.mendix.com/link/questions/2882
and a how to can be found here: https://docs.mendix.com/howtogeneral/tips/querying-over-self-references