When we can do it on our own, we get the credit, but when we cannot do it without God doing it through us, God gets the glory.
Yes, I am the vine; you are the branches. Those who remain in Me and I in them, will produce much fruit. For apart from Me you can do nothing. (Jesus) John 15:5
Not to us, O Lord, not to us, but to Your name goes all the glory for Your unfailing love and faithfulness. Psalm 115:1