Every skill takes time to learn. You will learn more with practice. So be patient and keep coding.
In simple words this part of code override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
belongs to UITableView class
and was written by developers, that is why there is a word override before func, meaning you are overriding the code of the class which contains default values. You cannot override it twice in the same part of code that is why XCode emits error.
As for the second question. You are passing the values to another class. But another class has to accept those values in the first place. So you create vars in the second class and then when you initiate that class you are just passing it. Think like so: in order to work and exist class B requires var C and var D. So you are creating that class like we created DetailedView and passed tha values C and D, and you can do whatever you want with them. BUT if you make your class B without any vars C and D and then trying to pass them to it. It says what the heck you are giving to me, i don't need that rubbish, leave me alone :)
You may also want to buy this book. I am not associated with the author in any way, just my recommendation. I still at times refer to that book, when i need to refresh my knowledge or learn something new. I know hard copy might be a bit expensive, but you can by ebook which is only 10$, almost free taking into account information in contains...
https://www.formasterminds.com/uikit_for_masterminds/