Definition of Done
The output of every Sprint is officially called a Potentially Shippable Product Increment. Before starting the first Sprint, the Product Owner, Team, and ScrumMaster have to review what is all needed for a Product Backlog item to be potentially shippable. All activities that are needed in order to ship the product should be included in the definition of Potentially Shippable and therefore should be done during the Sprint.
Unfortunately, when Teams start using Scrum, they are often not able to achieve the goal of delivering a Potentially Shippable Increment every Sprint. This is often because the team lacks in automation or isn’t cross-functional enough (e.g. the technical writers aren’t included in the cross-functional Team yet). Over time, the Team has to improve so they will be able to deliver a Potentially Shippable Product Increment every Sprint, but in order to start, they will need to create a baseline of their existing capabilities. This is recorded in the Definition of Done.
Before the first Sprint, the Product Owner and Team need to agree on a Definition of Done, which is a subset of the activities that are needed for creating a Potentially Shippable Product Increment (for a good Team, it will be the same). The Team will plan their Sprint work according to this Definition of Done.
A good Product Owner will always want the Definition of Done to be as close as possible to Potentially Shippable as that will increase the transparency in the development and decrease delay and risk. If the Definition of Done is not equal to Potentially Shippable, then work is delayed until before the release which causes this risk and delay. This delayed work is sometimes called undone work.
A Scrum Team should continuously improve, which is reflected in extending their Definition of Done.