Calculating mean of image collection and how does Google Earth Engine use pixels without data

I have 5 years of Landsat data that I stacked into an Image Collection. If I calculated the mean of that Image Collection, and a pixel does not have data for one or more of the years, is that pixel ignored in the calculation?

Additionally, I have a dataset of crop yields. If I check if the crop yield is less than the mean of the Image Collection and assign it a number, but a pixel does not have data for that year, is that pixel just not included in the calculation or is it represented by a 0 and therefore would be counted as less than?

//Create Image Stack

//#Mean/median of all years for each pixel
var mG = ColG.mean();
var mS = ColS.mean();
//mG<-ColG.reduce(ee.Reducer.mean());
//mS<-ColG.reduce(ee.Reducer.mean());

//#Grain
var reclass13 = ee.Image(1).where(y13.gte(mG),1000).where(y13.lt(mG),100);

If I calculated the mean of that Image Collection, and a pixel does not have data for one or more of the years, is that pixel ignored in the calculation?

Earth Engine will compute the mean of the values from all of the images that have pixels (are unmasked) at that location. If there are no such pixels (the mean would have no input values), then the output will be masked.

Additionally, I have a dataset of crop yields. If I check if the crop yield is less than the mean of the Image Collection and assign it a number, but a pixel does not have data for that year, is that pixel just not included in the calculation or is it represented by a 0 and therefore would be counted as less than?

You used the where operation. The documentation for where says:

If at a given pixel, either test or value is masked, the input value is used. If the input is masked, nothing is done.

The “test” image is y13, and the input is a constant ee.Image(1) which is fully unmasked (has data everywhere), so you'll get a 1 value where y13 is masked.

This is somewhat unusual; most arithmetic and other pixel-by-pixel image operations will mask an image wherever either input is masked (i.e. the result is valid only when both inputs are valid).