Is it safe to e-bike in the rain? It depends on the IP rating of the electric components of your e-bike
We see hundreds of e-bike models during our rides. We e-bike rain or shine, and see e-bikes' electronics malfunction under even mild raining conditions. Not all e-bikes perform well in wet conditions. Batteries die, cockpit displays become foggy and motors stop working. Inexpensive e-bikes do not always perform well in the rain.
Ingress Protection and E-biking
A quality e-bike is designed to be a reliable transportation tool, even while it rains and snows. Whether an e-bike is "rain or snow proof" depends on the IP rating of the electric components such as the battery, the electric cables, the motor, and the cockpit/board computer.

A blue Tern HSD Cargo E-bike covered by snow - E-bike Lovers.
A tire or a seat of an e-bike does not have an IP rating as no electric components are involved. An IP rating is not uniquely e-bike related. Cell phones, cameras, lights, earbuds, and other electronics have IP ratings.
An e-bike is often not IP rated, but it's electric components are.
IP stands for Ingress Protection and is a standard to measure an electric component enclosure's protection against ingress and contact with hazardous parts such as dust and water. The higher the IP classification of an e-bike's electric component, the more it is protected from the elements.

Source: https://www.bluesea.com/resources/117/IP_%5BIngress_Protection%5D_Ratings
The highest code is IP68. The Samsung Galaxy S21 range is IP68, for example. A submersible aquarium Pump is IPX8. It does not need to be dustproof at it is submerged in water.
Look for a product's IP rating when making a purchase. The product's IP rating is your way of knowing that the product is protected from particles or dust or water.
www.bluesea.com
Generally speaking, well-known brands such as Bosch and Panasonic have high IP ratings for an e-bike's electric components, and they are designed to be used in the rain and snow. Specialized even has some e-mountain bike motors that can be submerged in water for short periods.
Can I power-wash my e-bike?
The IP code also indicates if an electric component is protected under pressure. Although power-washing non-electric components of an e-bike, such as the belt, chain, panniers, and saddle, may be acceptable, likely, the electronics of your e-bike are not protected from the extra water pressure. Always check the owner's manual of your e-bike.

A Riese & Muller e-bike towing a Burley Nomad Cargo Trailer carrying a power washer - E-bike Lovers.
Be careful when you power-wash to protect the electric components of your e-bike and keep pressured water always away from anything related to electronics, sealants and bearings. As more e-bikes have batteries integrated into the frame, be extra careful not to powerwash the frame. That often means that only the tires and chain/belt can be power-washed.
Many manufacturers state not to power-wash their e-bikes to avoid accidental exposure to water under pressure. Perhaps you should also not swim with your e-bike (see the video below).
Conclusion
If you buy an e-bike from an established brand, its electronics are likely protected from the rain and snow. If you buy online from a lesser-known manufacturer, the protection from the elements may be less obvious.
Regardless of the brand, make sure that you check the IP rating of the e-bike's electric components before taking it out in the rain.
Knowing the IP rating may be the difference between walking or e-biking home or, worse, between e-biking home or writing off an e-bike altogether. Water and electricity don't mix well.
If you need to power-wash your e-bike, be careful. Read the owner's manual and keep pressured water always away from anything related to electronics, sealants, and bearings.