HEIC is a capture format
Apple made HEIC the iPhone's default in iOS 11 because it halves the size of an equivalent JPEG while adding 10-bit colour, HDR, depth maps and Live Photos. It is superb at holding everything a camera captured.
WebP is a delivery format
WebP exists to get an image into a browser quickly. It carries none of HEIC's capture extras, but every browser renders it — which HEIC has never managed and, given HEVC licensing, likely never will.
Compression is roughly a wash
At matched quality the two land within a few percent of each other. Choosing between them is not a size decision.
Converting HEIC to WebP
This is the common direction and the useful one: it takes a phone photo and makes it publishable. Both are lossy so a little quality is lost on re-encode — negligible above quality 80 — and HEIC extras like Live Photo motion, depth maps and HDR are dropped.
Converting WebP to HEIC
Less common, but it has a real use: normalising web-sourced reference images into the format an Apple photo library expects, so downloads sit consistently alongside camera-roll photos.