If I build a custom theme, will it update?

No. You don’t have to worry about updates.

The reason you need to worry about updates erasing changes to a theme is because when a theme is updated to a new version in WordPress the entire theme directory is replaced. This means that all files are replaced with fresh copies which won’t have any of your customisations applied.

As for how and why themes are updated, this is because when a theme is released on the WordPress.org Theme Directory the theme’s developers get the ability to update their theme, and these updates will be distributed as new versions to users of that theme. This appears as an “update available” notification in WordPress. ‘Premium’ themes often also implement their own update functionality that mimics this so that their developers can release new versions. So the only reason a theme is updated is because its developer chooses to release a new version. No themes are automatically updated just because a bundled library or framework is updated.

There is one caveat though. The way the updates from the theme directory work is shockingly simple: If WordPress sees a theme in the directory with the same name as your theme, but a higher version, it will see this as an update. So if you give your theme the same name as a theme in the directory, updating it could result in it being replaced by an entirely different theme. So it’s important to give your theme folder a unique name, ideally prefixed with something unique to you or your business.