Can you explain how did we derive the time complexity of Prim's Algorithm?

I know that it is O(V^2), and with the help of binary heap it reduces to O(ElogE). But I would like some explanation.

Please see the answers here https://stackoverflow.com/questions/20430740/time-complexity-of-prims-algorithm

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.