Main system RAM has nothing to do with a BAR. The BAR simply configures the device to decode access to those addresses. Normally the device contains a number of configuration registers. The BAR allows the CPU to access these registers as if they were a block of ram, but there isn't actually ram there. The PCIe root complex is configured to route most memory access to RAM, and access to a block of addresses, typically in the 3-4 GB area, to the PCIe bus instead. The BAR in a given device configures it to respond to a specific block of those addresses.
On the other hand, some devices, most notably video cards, actually do have their own ram on board that is accessed via the BAR.