This principle makes use of the fact that there is an equal number of red and black cards in the deck. Thus when two piles are formed, one with x cards and the remainder with 52 - x cards, then the number of red cards in x equals the number of black cards in the remainder plus 26 - x. A special case is that the two piles are equal, with 26 cards each, since in that case 26 - x = 0 and thus the red cards in one half equal the black cards in the other half.
The roots of the trick can be found in an old puzzle involving the literal mixing of wine and water. David Singmaster has traced this puzzle back to W. Rouse Ball's Mathematical Recreations And Problems Of Past And Present Times, Third Edition, 1896, p. 25, with roots in an earlier puzzle that dates back to Niccolò Fontana Tartaglia's General Trattato di Numeri et Misure, 1556. The first application to magic, involving red and black playing cards, appears to be Stewart James's "Tapping a Brain Wave" and "The Psychic Pickpocket", both devised in 1938, but not published until The James File, 2000, p. 1147-1149.
Oscar Weigle published “The Little Star Prediction” in Genii, Vol. 4 No. 3, Nov. 1939, p. 73. (It is presumably this publication that led Stewart James to avoid publishing his related routines.)
Robert Hummer made use of the principle, in expectedly unusual ways. See "The Magic Separation" and "Face Up Prediction" in Half-a-Dozen Hummers, 1940, p. 1 & 2, and a marketed trick, "Gremlins", 1943. Another notable application was “Pay Off” by Walter Gibson, the cover item of issue #1 of The Phoenix, Feb. 1942, p. 1.
The earliest use with unequal packets might be “Cardini's Color Discernment” in Scarne on Card Tricks, 1950, p. 165. Another application is Roy Walton's “Duo Colors” in The Pallbearer’s Review, Vol. 7 No. 9, July 1972, p. 547.