The difference between some/any and no article

Uncountable and plural nouns can be used with no article. They can also be used with some/any. Usually there is not a great difference of meaning.

We need to buy eggs. OR We need to buy some eggs.
I couldn’t buy any cheese. OR I couldn’t buy cheese.

The difference

Uncountable and plural nouns are used with some/any when we are thinking about limited but rather indefinite numbers or quantities. We use no articles with uncountable and plural nouns when we are not thinking about quantities or numbers at all.

Compare:

There is some water in the bottle. (Here the speaker is talking about a limited quantity of water.)
Is there water on the moon? (Here the interest is in the presence of water, not the amount.)
We bought some apples yesterday. (Limited but indefinite number)
I like apples. (General statement; no idea of number)

Notes

We do not use some/any when it is clear exactly how much or many is meant.

Compare:

She has written some good books. (We don’t know exactly how many.)
She has got pretty eyes. (A definite number – 2) (NOT She has got some pretty eyes.)

Difference between some and any

Some is usually used in affirmative sentences. Any is used in questions and negatives.

Have they got any children?
Yes, they have some. (NOT Yes, they have any.)
No, they don’t have any. (NOT No, they don’t have some.)