The indentions on the side are for a spanner wrench to tighten this nut onto a threaded rod. The top is a decorative cover.
The hole looks like it’s for a set screw to me, but I agree the cap is just a decorative cover. Not sure what this would be used for though as I don’t understand what function a collar and cap like this would do mechanically.
Edit: I see OP mentioned the holes don’t go through so you’re right they’d be for some special tool.
Does the “lid” screw in or snap onto the top
Edit: the hole in the side (tiny hole) should also have something to screw into it
The lid screws in.
There are three holes equidistant around the perimeter. They do not go all the way through.
i saw something like this once where it connects a tank of carbon dioxide to a sodastream type of drink bubbler.
I think I found the screw plug.
https://www.phoenixcontact.com/en-us/products/plug-for-cable-screw-gland-hc-bs-pg16-1674516
Looks like a spanner nut and the cap appears to be a jam screw to lock it in place.