A specification is anything written that describes how something is to be used or accomplished. They can be as informal as a sticky note or as formal as 100 page government regulation.
Specifications include some sort of declaration about how to refer to the different things involved and always has some form of data models.
Specifications also usually include parameters communicating how the things can be altered to perform differently and to what degree.
User Stories (Use Cases)
Most specifications contain a number of user stories that describe how a user uses the thing in some level of detail.
⚠️ User stories never say how something is done only what is done and the result.