echo statement displayed on front end

Yes, it is common sense and you are missing something 😉

Plugins are just away to add code to wordpress, by default they are not inferior or restricted in any way more then then core code. Just another file(s) that wordpress includes on startup.

It is your job as a plugin developer to restrict the execution of your code to specific area/context, and you do it by hooking your code on the relevant actions and filters.