In neonates, famotidine is primarily used to manage conditions associated with excessive stomach acid production, such as GERD and erosive esophagitis. Since neonates have immature digestive systems, they are more susceptible to these conditions, which can lead to complications like poor weight gain and respiratory problems.