Jamf is a device management solution. It enables remote control and management of the configured device.
Due to the nature of the software, it can restrict users of the machine (even the admin users) from performing certain administrative operations (depending on the applied configuration). It is also obvious that end-users cannot uninstall and/or quit Jamf application.
Jamf is one among many remote/mobile device management tool, generally used in enterprise/school environment to centrally manage a large number of mobile devices (laptops/tablets/phones). Jamf is absolutely not a virus or a ransomware.
You can learn more about Jamf product offering here:
There is absolutely no reason to throw away your MacBook. I'd advise you to get in touch with your friend and ask him for the reason why he installed it. You can also ask him to remove it if it was installed in accident or while out of curiosity.
A mobile device management solution is generally not required for personal devices.