Android currently does not support adding a notification which is always on the top. You can enable 'Pin on top' to keep the notification widget always on top.
For older android versions, the feature uses an accessibility service to put the widget back on top when a new notification arrives.
For on newer devices, a more efficient method is available using 'priority'. Setting high priority puts the widget on the top. But if another notification has same priority (like music players generally use high priority) any of the widgets can be on the top.