thats done in your backend --> simple example:
you have a php file on a webspace or server -> http://example.com/api/myPHPAPI.php?action=getData
in the php file you get the parameter action --> and that calls a function to get data of your database --> so you php scipt connects to your db and loads the data and sends them back to your frontend.
All what you need to do in your app ist sending a http-request to that address and waiting for the answer