Before JavaScript frameworks became popular, front end developers used data- attributes to store extra data within the DOM itself, without other hacks such as non-standard attributes, extra properties on the DOM.
It is intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements.