The VPN server knows your source IP address because it has to get packets back to you. This source IP address can be associated with your identity by law enforcement if they subpoena your ISP. They can’t get this source IP from logs (let’s just assume there are none), but they can figure it out via traffic patterns.
While there may be hundreds of outbound connections from the VPN server to all sorts of places on the Internet (further obscuring what you are actually doing), the right people can still identify the session traffic. From there they can see that a particular session is using X amount of data per minute.
Then they look at the connections to the VPN server (again, there may be hundreds) and they can see that session traffic. Now you can’t directly correlate the incoming session with the outgoing session by some packet identifier. But you could see a similar traffic amount in one in-bound session that matches an outbound session.
Now whoever is doing this investigation knows, with some reasonable probability, the source IP of the person on the anonymized side of the VPN. Maybe that’s not enough to close a case, but it would significantly narrow down the potential suspects.
If they kept up that monitoring, they could possibly generate a timeline. For example, at 2pm GMT the suspected host started transferring a lot of data and the anonymized VPN session also started transferring a similar amount of data. At 3PM GMT, the suspected host stopped the traffic and, look at that!, the anonymized session also stopped.
Your ISP is NOT going to do this. But the FBI can and will. Even if the VPN company has no logs and is running their servers in RAM, the data center where the VPN server is hosted (which is NOT owned by the VPN company and probably has policies to comply with any and all law enforcement) can give them access to the data streams to and from that VPN server.
If you are torrenting or just trying to hide porn viewing from your ISP, the FBI is not going to get involved. But if you are truly up to no good, a VPN may not do much to help. As others have said, it’s better than nothing, but you can’t trust it to be some magic anonymizing thing. And I bet you that the FBI (and CIA and NSA and KGB, MI5/6, etc…) all have software that will do that analysis and correlation pretty quickly. Heck it’s probably pre-installed at a lot of internet backbone data centers.