Bike to Trailer
As posted above, the electrical connection between your bike and tailer depends both on its wiring harness and on the degree of risk you're willing to accept. To be directly compatible with your bike's electrical system, the trailer will need to have turn signal lights that are separate from its brake lights, since the bike is a 5-wire system (ground, marker lights, left turn, right turn, brake lights). If your trailer is not equipped with separate turn signal lights, it typically has a 4-wire system where the brake lights double as turn signals (ground, marker, brake/left, brake/right). This will require you to wire in a "5-wire to 4-wire converter", which combines the vehicle's separate turn and brake signals into appropriate signals for the trailer's right and left brake lights. For example,
Trailer Isolation
This converter, if your trailer needs one, often does nothing to isolate your bike's lighting system from that of your trailer. And while it's not an uncommon arrangement to wire the connector on your bike directly into the bike's lighting harness, you are then powering the trailer's lights with the same wiring harness / relays / fuses driving your bike's lights. As others have pointed out, a fault in your trailer system can affect your bike's as well.
But a trailer isolator uses the bike's existing electrical system merely to drive the isolator's internal (mechanical or solid state) relays. The power actually driving the trailer's lights comes from a separately fused, direct connection to your bike's battery. At worst, trouble in the trailer's lighting system should only blow the isolator's separate fuse(s). Here's one commercial version:
You'll also see some devices out there that do double duty as both a 5-wire to 4-wire converter as well as an isolator, drawing power directly from the battery.
Murphy Happens
A couple of years ago I bought a small tent trailer for my FJR from a dealer up in Portland. It had a 5-wire wiring harness, so no converter was needed. But before heading up there, I did take the trouble to buy some relays, fuse holders and wire from my local electronics surplus store, and cobble together a home-made isolator. Potted the whole thing in epoxy, wired it into the tail light harness, and placed it under the passenger seat. Each output wire was over-engineered with its own fuse.
When I got up to Portland, the dealer had the trailer ready to go, except for the plug on its wiring harness. We compared notes on the pin-out of the connector on my bike (standard 5-wire), he wired the trailer side accordingly, and we hooked it up to the bike. Nothing! No trailer lights at all, but the bike's lights still worked fine. Took a closer look and almost all of the fuses in the isolator had blown! Seems he mis-wired the trailer's connector (off by one)...
Posi-Taps
That's what I used as well. Not as secure/reliable as s properly soldered joint, but much easier and cleaner to undo!