How does a plugin update and wordpress update works? And what will be the its effect if for example I modified the codes of a plugin and then after some time, I will update it with the latest update of wordpress and those plugins?
Wordpress updates replace files with new versions of those files, add new files, and remove unneeded files. Same goes for plugin updates. If you've modified plugin or core files and you update that plugin or wordpress, respectively, then you will lose any modifications you have made to those plugins if that file is replaced or deleted.