Both are grounded in rationality; that's not specific to just science. That's not how you define Science. Science is defined as a process of systematic observation, measurement, and experiment, leading to the formulation, testing, and modification of hypotheses --things that the more abstract field of Philosophy is not concerned with.
Philosophy is the study of general and fundamental problems, such as those connected with reality, existence, knowledge, values, reason, mind, and language.[1][2] Philosophy is distinguished from other ways of addressing such problems by its critical, generally systematic approach and its reliance on rational argument.[3] In more casual speech, by extension, "philosophy" can refer to "the most basic beliefs, concepts, and attitudes of an individual or group"
BTW, logically and historically all science is philosophy and vice versa. The special branches of science are philosophies limited to certain areas unified by the all-encompassing concept of rationality.