Later Registration by Another
If someone sees my logo and does a trademark search and sees that I've haven't registered it as a trademark, can they then register the trademark and enforce it against me?
Not easily.
Under 15 USC 1051 a person (or firm; I will include firm in person after this) who applies to register a trademark must certify that:
to the best of the verifier’s knowledge and belief, no other person has the right to use such mark in commerce either in the identical form thereof or in such near resemblance thereto as to be likely, when used on or in connection with the goods of such other person, to cause confusion, or to cause mistake, or to deceive ...
or if the mark or a similar mark is already in use by another, the application must list all; such uses, and indicate why the new registration would be acceptable. This would be on the record as part of the application, \and would be evidence ofd prior use.
If the applicant knows of the similar mark but does not list it, the application is fraudulent and may be canceeld if this comes to light.
If the PTO finds that there is existing concurrent use of the mark or a confusingly similar mark, that is reason to refuse the application for registration
under 15 USC 1052.
The user of a similar mark, or anyone who expects to be damaged by a registration my object under 15 USC 1063 within 30 days of registration, or may later file for cancellation of the registration under 15 USC 1064 within 5 years. After that a mark may become incontestable, but even then prior use can be a defense to an infringement action.
It is a defense under 15 USC 1115(b)(5):
That the mark whose use by a party is charged as an infringement was adopted without knowledge of the registrant’s prior use and has been continuously used by such party or those in privity with him from a date prior to (A) the date of constructive use of the mark established pursuant to section 1057(c) of this title, (B) the registration of the mark under this chapter if the application for registration is filed before the effective date of the Trademark Law Revision Act of 1988, or (C) publication of the registered mark under subsection (c) of section 1062 of this title: Provided, however, That this defense or defect shall apply only for the area in which such continuous prior use is proved;
Registration furnishes evidence presumed to be valid under 15 USC 1115(a) that the mark registered is valid and the rights to it are owned by the registrant, (subject to any limitations listed in the registration, such as known concurrent use). This evidence can be overcome by proof of prior use, but the burden of proof is on the person who challenges the registration.
In short a later registrant could bring and win a suit if the earlier user could not prove contentious use from before the registration, but not otherwise.
Previous Use or Registration by Another
Or am I only at risk of accidentally infringing an already-existing trademark (such as if I didn't conduct my trademark search correctly).
In that case you may be at risk. Use of a mark that is identical or confusingly similar to an existing mark, for the same category of goods or services, in the same market area is infringement. This is true even if the infringer was unaware of the other mark, although that may reduce the damages.
Registration is evidence of the ownership of the mark, and may be conclusive. It also acts as evidence that the infringer should have known of the mark, and makes "innocent infringement" harder to establish.
Benefits of Registration
Registration forces a through and professional search for possibly conflicting trademarks. It establishes that such a search was done. It establishes that the registrant had no knowledge of any prior use of the mark, nor, could the USPTO find any. It puts the evidentiary weight on the registrant's side under sec 1115.
Whether that is worth the costs and effort is a business decision.