LokiJS is a in-memory DB, which means it will allow you to load, query etc all your data in-memory. Since it is written in Javascript, it will work on multiple environments, inside your browser, inside a NodeJS application, inside a Cordova app etc.
If you are using this inside a Browser application, it can use localstorage or indexedDB to store the data.
If you are using this inside a NodeJS application, it can use the file system or another DB (MySQL, mssql, etc) to store the data.
If you are using this inside a Cordova application, it can use SQLite to store the data.
Basically, depending on where are you running your application and what storage options are available on that platform, it will use that to persist the data.
You can look here to see different adapters available to store data on different platforms-