i have heard jeffery way and lots of articles say that static calls are bad and they affect the performance. But what i would like to understand is what is happening behind the scenes? What does the programming language do differently for static methods that it affects performance ? And if there are other reasons for it as well
Static methods allow procedural/functional code to be shoe-horned into an Object Oriented world. Using static methods and variables breaks a lot of the power available to Object-Oriented code.
The technical implementation of them is to allow state to be maintained across all instances of a class. The problem is that this is intrinsically not OOP because it disregards encapsulation. If a variable can be altered by any instance of a class then the fundamental principle behind encapsulation/information hiding is lost entirely: An object is no longer in complete control of its state. Its state now relies on variables which are essentially global. Which we know is bad. Even private static variables maintain state at a global level but simply limit its access. Any instance of the object can alter the static variable which causes ambiguity as individual instances of the object no longer have control over their own state. State changes can arbitrarily happen without knowledge of an object which relies on that state which is problematic because the object may not work correctly when this happens. Much as it's often said that "Inheritance breaks encapsulation" statics do this in a far more severe way: By not just exposing internal implementation but also by exposing internal state.
It just depends on how you will use them. For the most part in your code you won't be using them because they won't be the tool you actually seek for.
When you instantiate an object with the same dependencies and arguments, you should be able to rely on it behaving the same way regardless of when and where it was created, right? It would be kind of infuriating otherwise at least.
But when you use a static method, that object is no longer fully in control of it's behavior. Instead of injecting the dependency, where the dependent class has control over its instance, there's no way to know if someone or something else is changing the class in a way that will alter the outcome of your method call.