It does have something to do with inheritance. Inheritance directly causes wealth inequality because some people inherit money while others don't (and the amounts inherited vary widely). It's not the only mechanisms which causes wealth inequality, but it is one of them.