For pills there exists a service which can ID them based on markings, shape, color, etc. I buy the grab bags of ICs from Jameco and sometimes get a part or two that I can't identify within a few pages of a google search. Does such a service exist for ICs and other chips?
Most electronic components have part numbers which you can search for. Google is a good start, but parts often have many variations with different prefixes or suffixes, and small parts may be marked with truncated or special codes. Google ignores some text symbols and doesn't search for partial words, so its ability to find electronic parts is limited. Searching on various attributes of the part such as package type, number of pins and probable function can sometimes help to narrow down the search.
You may get better results from sites dedicated to finding electronic datasheets or decoding smd markings. Here is short list of popular sites:-
Many parts also have date codes which vary 'randomly', and trying to determine which digits are the actual part number can be tricky. You can get an idea of how different manufacturers mark their components by looking at their datasheets, or by Googling images of similar parts.
You can also try doing a Google image search on the markings or other attributes of your item, or even photograph it and upload the image for Google to search for.