Why the "gray box"? This is the color that appears when you mix black and white. This means: we know what we should get out of the app, but we're not sure how exactly it works.
The gray box method is a combination of the white box and black box methods when the tester has access to one part of the code and the architecture only. That is, the internal device of the application is only partially known to us. The tester is given, for example, access to the internal structure and software operation algorithms for writing the most effective test cases, but the testing itself is carried out using the black box technique, that is, from the user's point of view. Usually, they talk about the methods of the white or black box as applied to certain parts of the application while realizing that the entire application is being tested using the gray box method.
The gray box technique is applicable at different levels of testing, from unit to system, but is mainly used at the integration level to test the interaction of different application units.