the prefix is there to namespace the tables so one database can safely hold multiple installations without table-name collisions.
Usually the installers let you chose a prefix for that reason.
It has very minimal security value however.
Changing the default prefix can slightly reduce exposure to automated attacks that assume standard WordPress table names, but it does not stop SQL injection or any real attack on its own. In practice, security depends much more on patching, safe plugin/theme code, least-privilege database users, and good server hardening than on the prefix name.