When the Athenian children were arriving on the boat Ariadne noticed Theseus.
The children of Athens would be sacrificed to the minotaur.
She makes a plan to save them, she secretly meets Theseus and gives him a ball of twine and a sword, to help him slay the minotaur, if he'd promise to marry her and take her away.
Theseus enters the labyrinth, whilst leaving a trail of the ball of twine so he can get back out. When he sees the minotaur he slays it and escapes by reeling in the ball of twine and escapes and sails away with Ariadne.
Theseus sails to an island and tells Ariadne that she should sleep more and early in the morning Theseus sails away and leaves Ariadne on the island.
Ariadne smiles at the black flag when they were sailing away because the black flag represented that Theseus was dead even though he was on the boat.