Guess I'll break the whole thing down, just to cover everything...
When you run the require() call, it looks for either a file called "sti", or a folder by that name. If it's a folder, the require() call then checks if it contains an init.lua file, runs it, and returns a value, usually a table containing the library API. This kind of folder that contains a init.lua is common among bigger or older lua libraries, that serve a bigger purpose that can not neatly be contained within a single lua file. So, in an essence the require() call loads and initializes STI before anything else is done within your main.lua.
Some smaller libraries instead ask you to require a single file, so it's understandable why you might be unfamiliar with the way STI works.
After that first line, you have defined the usual LÖVE callbacks. These are run in a specific order, as specified by
love.run, the main loop function. If you don't override or love.run, what tends to happen is:
1. LÖVE looks up conf.lua, runs it, and returns (conf.lua is optional, but recommended)
2. LÖVE runs main.lua
3. LÖVE runs the contents of love.load, if it has been defined
4. LÖVE starts running the main loop returned by love.run, processing things in the order of
--> Poll events (keyboard strokes, controller button presses, etc), and run the relevant handler functions (eq. love.keypressed)
--> Run the contents of love.update, passing in the delta time between frames (or 0 if love.timer is disabled)
--> Run the contents of love.draw, if a window and graphics modules have been initialized
--> Sleep the LÖVE process for a moment (so not to take too much CPU time from the host PC), before looping again
So, with STI loaded and the love.load, love.update and love.draw callbacks defined, you pass a file path to STI in love.load. If you look at the STI library's init.lua's contents, you'll find something like "STI.__call", which calls a local function called "new". You might notice that the require() returns a table, but STI uses lua's metatable mechanisms to say that "use this __call function when this table is called like a function" (you can read more about metatables
here and
here).
Anyway, those functions basically take a filepath (and optional arguments) and constructs an object. This object will represent the map you're loading, containing some functions such as update() and draw() - that will help you do the respective tasks. After the object has been constructed, it's returned, and you simply assign it to a variable like you do in love.load. And then every frame you call the respective functions in love.update and love.draw contained within the object.
As such, if you later wanted to load a new map, you'd basically reassign another map into the 'map' variable by calling the STI library with another filename, and that's that.