By default, the items in Gantt will build a hierarchy as below. This applies for both Classic and Next-Gen projects.
------ Story/Task/Bug that are associated to the epic.
-------- Sub-task that are associated to the above Story/Task/Bug.
--- Normal Story/Task/Bug(that are not linked to any epic)
------ Sub-task that are associated to the above Story/Task/Bug.
--- Orphaned tasks(when the linked epic/parent is filtered out or not available). Note: Orphaned tasks cannot be moved up/down, indented or outdented.