Why add Essaouira?
Essaouira offers a different rhythm from Marrakech and Fes. The scale is smaller, the medina is easier to navigate and the Atlantic changes the pace of the trip.
How long to stay
Two nights is a strong minimum. Three nights works especially well at the end of a busier itinerary.
What to build around
Seafood, port life, medina walks, galleries, beach time and a slower schedule are usually more valuable here than stacking many activities.