Are ids strictly sequential i.e. does later added content always have higher id? I thought that ids (user id, node id, ...) are strictly sequential which ensures that later added content has always higher id that a previously added one. So that when I have a hierarchy (lower element has a reference to its parent) and the 'reference' is not editable (set on creation) I can safely assume that a child has higher id that a parent.

The problem is that in this question @berdir (who I believe knows a few things about Drupal) says that it does not have to be the case... 

I know that gaps might appear in the sequence (e.g. when an entity is deleted) but I'm not sure that he meant just that (and I'd rather be sure).

So my question is, how is in reality and when can I not the sentimentality of ids?

//DISC: The hierarchy system is quite complex and (of course) doesn't rely on ids comparison, the aforementioned concept is used just in one case due to optimization.
User IDs and Node IDs are automatically incrementing (mysql, postgresql, sqlite) fields. Once an id has been used, it should not be used again (in the case of deleted content). 

The higher the number, the later it was inserted into the database.

You could always end up with imported content that is older, but now has a higher Node/User ID because it was inserted at a later time.

You may want to look to the Relation module, or even Drupal's own menu system to define hierarchies.  This depends completely on your use case of course.