From a physiological perspective, the short answer is: Very difficult, almost impossible to achieve sustainable muscle gain without the exercise factor.
Muscles develop based on an important principle which is the process of muscle fibers increasing in size when under pressure, especially from activities such as weightlifting or resistance training. When muscles are "microbially damaged" during training, the body will repair and rebuild them to be larger and healthier. Without this stimulation, the body has no biological reason to increase muscle.
However, there are still some factors outside of exercise that can affect muscle mass. Diet is the most important factor. Providing enough protein, especially from sources such as eggs, meat, fish, or beans, helps the body have materials to build muscle. Besides, hormones such as testosterone and growth hormones also play a major role in muscle development. People with naturally high hormone levels can maintain or slightly increase muscle mass even when they are less active, but this increase is often very limited.
Some people turn to methods such as using supplements or anabolic drugs to gain muscle without exercise. However, this is a path that potentially poses many health risks, especially affecting the liver, cardiovascular system and endocrine system. Moreover, gaining muscle in this way is often unsustainable and can have long-term consequences.
Light activities such as walking, housework, or daily exercise can still help maintain muscle at a certain level, especially in beginners or those who have been less active before. But to achieve noticeable muscle development, intensive and resistant exercises are still irreplaceable.
Although nutrition and hormonal factors can support, exercise is still the core foundation to increase muscle in an effective and sustainable way. Ignoring this factor means significantly limiting the ability to improve physical fitness.