Sticky notes are stuck to any window based on the title of the window. When you stick a note to Word doc, it captures the title of the Word doc. The title also contains the file name. So in a way, you are sticking the note to that particular doc.
Check out this video that will tell you more about this feature:
The note doesn't get embedded inside the doc. The note doesn't go with the doc. Just that when you open the doc, you will also see the sticky note appear. Same goes for websites, programs & folders too.
The note cannot be stuck to specific part of the doc.