When we test load in Jmeter and an API makes a call to database; do we test server load or database load ?
If you're using JMeter's HTTP Request samplers to conduct the load onto API endpoint(s) you stress the server. If the API executes a database call under the hood the database is experiencing the load as well.
If you're using JMeter's JDBC Request samplers to conduct the load onto the database then only the database is experiencing the load, the server which runs the API isn't stressed by any means.
You can use i.e. JMeter's PerfMon Plugin to see the impact of your JMeter load test onto different tiers of your application: application server, database, load balancers, and other middleware
JMeter does not understand how your server is configured, it only looks at the responses and their timings.
Meaning that it cannot analyze any component of the server/servers in isolation, such as load balancer and databases.