What’s most vulnerable the data or the DBMS?


When data breaches occur, do hackers figure out how the data is stored and read this or do they just figure out how to make queries to the database via the DBMS? Which is more likely