If you want to show "past ability" in the second context, you would want "I could have lent you my car yesterday (but today I cannot)." The second part is optional and could be implied.
You could also use this construction if you want to contrast:
"I could loan you the car yesterday, but today I need it/I can't/it's in the shop." (This would make more sense in response to a setup like "You said yesterday that you could loan me the car!" "Yesterday, I could. Today, I cannot." Some strict grammarians might insist that this should still be "could have" instead of "could", but colloquially, I hear and see "could" here alone all the time.)
If you write "I could loan you my car.", could here is giving a present possibility, and depending on context could be an open offer "If you need a ride, I could loan/lend you my car." a conditional offer "I could lend you my car if you fill it up." or even a refusal "I could lend you my car, but I don't trust you enough." In this last, it states the possibility of the action, while the second phrase says that you won't be acting on that possibility.
The "past capability" construction of could is almost always used in a context where the timeframe is stated or implied by the surrounding context.
You wouldn't see "I could swim." as past capability, but as a statement of a possibility right now. "But I'd rather not." for example. It means "This is something I could do right now but might not."
For past capability, it would be "I could swim when I was younger." or the like, meaning "I used to be able to".